import os
# from pandas import read_csv
from opencc import OpenCC

cc = OpenCC("s2t")
now_dir = os.getcwd()
print(now_dir)
# os.chdir(now_dir)

file_names = os.listdir(now_dir)

del_params = []

del_params1 = [
    "春義",
    "豊",
    "青年",
    "潤",
    "和人",
    "武雄",
    "悟志",
    "博也"
]

del_params2 = [
    "人",
    "小出",
    "贞",
    "舟木",
    "原",
    "池",
    "一骑",
    "会长",
    "部员",
    "主将",
    "流浪",
    "大野",
    "进士",
    "井"
]

del_params.extend(del_params2)

del_params_cc = [cc.convert(i) for i in del_params2]

del_params.extend(del_params_cc)

image_minsize = 200 * 1024 # kb


def del_fuc():
    for name in file_names:
        file_path = os.path.join(now_dir, name)
        for param in del_params:
            if os.path.getsize(file_path) < image_minsize:
                os.remove(file_path)
                break
            if param in name:
                os.remove(file_path)
                print(file_path + "del_params")
                break


if __name__ == "__main__":
    del_fuc()
    pass